/**
 * vue插件：注册项目所有的全局组件
 * v2和v3编写插件的变化：
 * 1. 整体写法不变
 * 2. v3的install方法的第一个参数发生变化=》app实例 | v2的install方法的第一个参数是Vue构造函数
 */
import Skeleton from './Skeleton'
import Slider from './Slider'
import More from './More'
import Bread from './Bread'
import BreadItem from './Bread/item.vue'
import InfiniteLoad from './InfiniteLoad/index.vue'
import City from './City'
import Sku from './Sku'
import Numbox from './Numbox'
import Button from './Button'
import CheckBox from './CheckBox'
import Message from './Message/index.vue'
import Dialog from './Dialog'
const cps = [Skeleton, Slider, Dialog, More, Bread, BreadItem, InfiniteLoad, City, Sku, Numbox, Button, CheckBox, Message]
export default {
  install (app) {
    // console.log('实例：', app)
    // 手动注册
    // app.component('Skeleton', Skeleton)
    // 循环自动注册=》推荐
    cps.forEach(cp => {
      app.component(cp.name, cp)
    })
  }
}
